#include "InfoTreeWidgetItem.h"

InfoTreeWidgetItem::InfoTreeWidgetItem(QTreeWidgetItem *parent)
	: QTreeWidgetItem(parent)
{
	infoMap.insert("type","NULL");
}

InfoTreeWidgetItem::InfoTreeWidgetItem(int type)
{
}

InfoTreeWidgetItem::~InfoTreeWidgetItem()
{
}

void InfoTreeWidgetItem::appendInfo(QString key, QString value)
{
	infoMap.insert(key, value);
}

void InfoTreeWidgetItem::removeInfo(QString key)
{
	infoMap.remove(key);
}

QString InfoTreeWidgetItem::getInfo(QString key)
{
	QMap<QString,QString>::Iterator iter=infoMap.find(key);
	if (iter != infoMap.end())	{
		return iter.value();
	}
	else	{
		return QString("");
	}
}
